﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Compiler
{
    class CompilerData
    {

        public List<string> ReservedWords;
        public List<string> operator_signs;

        public List<string> DataTypes;
        public Dictionary<int, string> Error_list;

        public CompilerData()
        {

            DataTypes = new List<string>();
            Error_list = new Dictionary<int, string>();
            ReservedWords=new List<string>();
            operator_signs = new List<string>();
            initialize();
           
            //FillTokensDataTypeList();

        }

        private void initialize()
        {
            //define reserved words
            ReservedWords.Add("robot");
            ReservedWords.Add("endrobot");
            ReservedWords.Add("make");
            ReservedWords.Add("if");
            ReservedWords.Add("wait");
            ReservedWords.Add("endif");
            ReservedWords.Add("for");
            ReservedWords.Add("endfor");
            ReservedWords.Add("do.while");
            ReservedWords.Add("do.unless");
            ReservedWords.Add("to");
            ReservedWords.Add("stop");
            ReservedWords.Add("print");
            ReservedWords.Add("readsensor");
            ReservedWords.Add("savstatus");
            ReservedWords.Add("savstatus");
            ReservedWords.Add("forward");
            ReservedWords.Add("forwardr");
            ReservedWords.Add("forwardl");
            ReservedWords.Add("backword");
            ReservedWords.Add("backwordr");
            ReservedWords.Add("backwordl");
            ReservedWords.Add("and");
            ReservedWords.Add("or");
            ReservedWords.Add("not");
            ReservedWords.Add("true");
            ReservedWords.Add("false");
            //ReservedWords.Sort();
            //define operators
            operator_signs.Add("=");
            operator_signs.Add("<");
            operator_signs.Add(">");
            operator_signs.Add("<=");
            operator_signs.Add(">=");
            operator_signs.Add("*");
            operator_signs.Add("/");
            operator_signs.Add("+");
            operator_signs.Add("-");


            DataTypes.Add("char");
            DataTypes.Add("byte");


            /*
             *      return 5;  //syntax error declared before 
                                return 8; // unknow identifier 
                            return 7; //sytax srror bad close of the string end
                        return 8 ; //sytax error unknown identifier

             * */
            //errror list
            Error_list.Add(1, "Command  begin with  Program Identifer");
            Error_list.Add(2, "Error in block");
            Error_list.Add(3, "Identifier already exist or it is reserver Word !!!");
            Error_list.Add(4, "Missing FinishProg");
            Error_list.Add(5, "identifier declared befor ");
            Error_list.Add(7, "bad close of string");
            Error_list.Add(8, "unknown identifier");
            Error_list.Add(9, "Error in declaration statment");
            Error_list.Add(10, "Error in Assignment statment");
            Error_list.Add(11, "identifier must be declared first"); 

            
          
        }
      

    }
}
